package com.ph.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ph.mapper.DepartmentMapper;
import com.ph.pojo.Department;
import com.ph.service.DepartmentService;
import org.springframework.stereotype.Service;

import java.util.Collections;
import java.util.List;

@Service
public class DepartmentServiceImpl extends ServiceImpl<DepartmentMapper, Department> implements DepartmentService {
    @Override
    public List<Department> findByTree() {
        return baseMapper.findByTree(0);
    }

    @Override
    public List<Department> findByParentId(Integer parentId) {
        return baseMapper.findByTree(parentId);
    }
}
